<?php

/**
 * Description of Helpers_ProductPrice
 *
 * @author a.novikov
 */
class Helpers_ProductPrice extends Helpers_Base {

	public function getViewPath() {
		return 'layouts/blocks/product_price.tpl';
	}

	public function productPrice(List_Product_Base_SmallBlock $product) {
		
		$alt = 'Положить товар в корзину';
		$button_class = '';
		
		if ($product->subproducts_count) {
			$button_class = 'multiple';
		}
		else {
			if ($product->in_basket) {
				$alt = 'Товар уже в корзине';
				$button_class = 'basket-btn-in';
			}
			elseif (!$product->count || !$product->price) {
				$alt = 'Товар отсутствует';
				$button_class = 'basket-btn-none';
			}
		}

		$this->view->alt = $alt;
		$this->view->button_class = $button_class;

		$this->view->product = $product;
		
		return $this->render();
	}
}